import java.util.List;

import javax.sql.DataSource;

import cn.com.mjsoft.framework.persistence.core.PersistenceEngine;

public class ShowAPI
{

    public static void main( String[] args )
    {
        /**
         * 注意！！：生产系统中使用数据库连接池，以下仅为演示
         */
        DataSource ds = new MySqlDataSourceCommon( "", "", "", "", "" );

        String sql = "select * from testtable";

        PersistenceEngine pe = new PersistenceEngine( ds );

        try
        {
            pe.beginTransaction();

            List res = pe.queryResultMap( sql );

            // do something

            pe.commit();

        }
        finally
        {
            pe.endTransaction();
        }
    }
}
